#ifndef _modelprimitive_h_included_
#define _modelprimitive_h_included_
#include <d3dx9.h>
#include <d3d9.h>
#include <string>
#include "DXUtil.h"
#include "Mesh.h"
#include "Model.h"

//This class is responsible for maintaining the state
//of a model
class ModelPrimitive:public Model
{
	LPD3DXMESH mMeshPrim;
	D3DMATERIAL9 mMaterial; //The models material

public:
	//Default Constructor sets most everything to zero
	ModelPrimitive();	
	//Draws the model
	void LoadContent(LPDIRECT3DDEVICE9 d3ddev);
	void Draw(LPDIRECT3DDEVICE9 d3ddev);

	D3DMATERIAL9* GetMaterial();	
	void SetMaterial(D3DMATERIAL9* pMat);

	void SetTeapot(LPDIRECT3DDEVICE9 d3ddev,LPD3DXBUFFER *ppAdjacency);
	//ppAdjacency should be null, 
	void SetSphere(LPDIRECT3DDEVICE9 d3ddev,
						FLOAT Radius,
                        UINT Slices,
                        UINT Stacks,
                        LPD3DXBUFFER *ppAdjacency);
	void SetBox(LPDIRECT3DDEVICE9 d3ddev,
						float Width,
						float Height,
						float Depth,
						LPD3DXBUFFER *ppAdjacency);
	void SetCyclinder(LPDIRECT3DDEVICE9 d3ddev,
						float Radius1,
                        float Radius2,
						float Length,
						UINT Slices,
						UINT Stacks,
						LPD3DXBUFFER *ppAdjacency);

	//Releases the objects mesh.
	void Release();
};
#endif
